package com.example.mybatis.plus.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 服务节点信息表
 * </p>
 *
 * @author ihumors
 * @since 2022-10-10
 */
@TableName("id_worker")
@ApiModel(value = "IdWorker对象", description = "服务节点信息表")
public class IdWorker implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("自增id")
    @TableId(value = "worker_id", type = IdType.AUTO)
    private Integer workerId;

    @ApiModelProperty("ip")
    private String ip;

    @ApiModelProperty("port")
    private Integer port;

    @ApiModelProperty("ip:port")
    private String localhost;

    @ApiModelProperty("最后一次心跳时间戳")
    private Long maxTimestamp;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    public Integer getWorkerId() {
        return workerId;
    }

    public void setWorkerId(Integer workerId) {
        this.workerId = workerId;
    }
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }
    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }
    public String getLocalhost() {
        return localhost;
    }

    public void setLocalhost(String localhost) {
        this.localhost = localhost;
    }
    public Long getMaxTimestamp() {
        return maxTimestamp;
    }

    public void setMaxTimestamp(Long maxTimestamp) {
        this.maxTimestamp = maxTimestamp;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "IdWorker{" +
            "workerId=" + workerId +
            ", ip=" + ip +
            ", port=" + port +
            ", localhost=" + localhost +
            ", maxTimestamp=" + maxTimestamp +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
